//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package rent.hj.videoplayer.subTitle;

import java.io.IOException;
import java.io.Reader;
import java.io.StreamTokenizer;

public class SmiTokenizer extends StreamTokenizer {
    static int SMI_TEXT = -1;
    static int SMI_P = -2;
    static int SMI_SYNC = -3;
    static int SMI_BODY = -4;
    static int SMI_NBSP = -5;
    static int SMI_UNKNOWN = -6;
    static int SMI_EOF = -7;
    static int SMI_STYLE = -8;
    static int SMI_CSS = -9;
    static int SMI_TITLE = -10;
    static int SMI_BR = -11;
    boolean outsideTag = true;

    public SmiTokenizer(Reader r) {
        super(r);
        this.resetSyntax();
        this.wordChars(0, 255);
        this.ordinaryChar(60);
        this.ordinaryChar(62);
    }

    public int nextHtml() {
        try {
            switch(this.nextToken()) {
                case -3:
                    if(this.sval.trim().length() == 0) {
                        return this.nextHtml();
                    } else if(this.sval.toUpperCase().indexOf("STYLE") != -1 && !this.outsideTag) {
                        return SMI_STYLE;
                    } else if(this.sval.toUpperCase().indexOf("SYNC") != -1 && !this.outsideTag) {
                        return SMI_SYNC;
                    } else if(this.sval.toUpperCase().indexOf("!--") != -1 && !this.outsideTag) {
                        return SMI_CSS;
                    } else if(this.sval.toUpperCase().indexOf("P") != -1 && !this.outsideTag) {
                        return SMI_P;
                    } else if(this.sval.toUpperCase().indexOf("/BODY") != -1 && !this.outsideTag) {
                        return SMI_BODY;
                    } else if(this.sval.toUpperCase().indexOf("TITLE") != -1 && !this.outsideTag) {
                        return SMI_TITLE;
                    } else if(this.sval.toUpperCase().indexOf("BR") != -1 && !this.outsideTag) {
                        return SMI_BR;
                    } else {
                        if(this.outsideTag) {
                            return SMI_TEXT;
                        }

                        return SMI_UNKNOWN;
                    }
                case -1:
                    return SMI_EOF;
                case 60:
                    this.outsideTag = false;
                    return this.nextHtml();
                case 62:
                    this.outsideTag = true;
                    return this.nextHtml();
                default:
                    return SMI_UNKNOWN;
            }
        } catch (IOException var3) {
            return SMI_UNKNOWN;
        }
    }
}
